package com.ihr360.common;


import java.io.Serializable;

public abstract class NumberId<T extends Number>  implements Serializable {

    protected T id;

    public NumberId() {
    }

    public NumberId(T id) {
        this.id = id;
    }

    public T getId() {
        return this.id;
    }

    public void setId(T id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NumberId<?> that = (NumberId<?>) o;

        return !(id != null ? !id.equals(that.id) : that.id != null);

    }

    @Override
    public int hashCode() {
        return id != null ? id.hashCode() : 0;
    }
}